#ifndef PARSER_H
#define PARSER_H

#include <QObject>

#include "resource.h"
#include "category.h"
#include "itemhandler.h"

const QString RESOURCES("[Resources]");
const QString CATEGORIES("[Categories]");
const QString COLOR("color");
const QString NAME("name");
const QString IMAGE("image");

class Parser : public QObject
{
    Q_OBJECT
public:
    explicit Parser(QObject *parent = 0);
    explicit Parser(ItemHandler *itemHandler, QObject *parent = 0);

    void parse(QString fileName = QString(""));

    enum State{RESOURCE, CATEGORY, UNKNOWN};

signals:

public slots:

private:
    void readResource(QString line);
    void readCategory(QString line);

    ItemHandler* mItemHandler;
    State state;

};

#endif // PARSER_H
